package com.cellngine.server.model;

import com.cellngine.Cellngine;

/**
 * All other objects are based off of this definition.
 * 
 * @author jboer <jboer@jboer.nl>
 * 
 */
public class BaseObject implements Comparable<BaseObject>
{
	private long	unid;
	
	public BaseObject()
	{
		this.unid = Cellngine.newUNID();
	}
	
	public long getUNID()
	{
		return this.unid;
	}
	
	public boolean equals(final BaseObject obj)
	{
		return obj.getUNID() == this.unid;
	}
	
	@Override
	public int compareTo(final BaseObject o)
	{
		//TODO: do this manually? -JB
		return new Long(this.unid).compareTo(o.getUNID());
	}
}